﻿/**	@file		std_v2t.hpp
 *	@date		(2007-08-02 21:10:42)/(2009-11-21 19:26:07)
 *-----------------------------------------------------------------------------
 *	@version	1.0.2.2
 *	@author		Nick Shallery	(nicknide@gmail.com)
 *	@copyright	YOU HAVE ALL LEFT WITH THIS CODE WHILE YOU KEEP COMMENT IN EVERY COPY.
 *-----------------------------------------------------------------------------
**/


#if			!defined(__LOLIX__TOY__STD_V2T__NICK__K_IN_G__)
#define		__LOLIX__TOY__STD_V2T__NICK__K_IN_G__
//==============================================================================
//--------------------------------------------------------------------------

#if			defined(__cplusplus)

#if			!defined(__LOLIX__LOLI_X_CFG__K_IN_G__)
	#include	"../lolix_cfg.h"
#endif	//	!defined(__LOLIX__LOLI_X_CFG__K_IN_G__)

#if			!defined(__LOLIX__LOLIX_TYPE__K_IN_G__)
	#include	"../lolix_type.h"
#endif	//	!defined(__LOLIX__LOLIX_TYPE__K_IN_G__)


namespace lolix{namespace toy{
	namespace _help{
		class _v2t_base_memory
		{
			typedef	_v2t_base_memory	this_type;
		public:
			typedef	size_type			size_type;
			typedef	ptrdiff_type		difference_type;
		};
	}

	template<typename _Ty>
	class v2t_trait
		: public _help::_v2t_base_memory
	{
		typedef	_help::_v2t_base_memory		base_type;
		typedef	typename remove_reference<_Ty>::type	_RawTy;
	public:
		typedef	base_type::difference_type	difference_type;
		typedef	base_type::size_type		size_type;

		typedef _Ty				value_type;

		typedef _RawTy const&	const_reference;
		typedef _RawTy const*	const_pointer;

		typedef _RawTy&			reference;
		typedef _RawTy*			pointer;
	};

	template<typename _Ty>
	class v2t_trait<const _Ty>
		: protected _help::_v2t_base_memory
	{
		typedef	_help::_v2t_base_memory			base_type;
		typedef	const typename remove_reference<_Ty>::type	_RawTy;
	public:
		typedef	base_type::difference_type	difference_type;
		typedef	base_type::size_type		size_type;

		typedef	const _Ty		value_type;

		typedef	_RawTy&			const_reference;
		typedef	_RawTy&			reference;
		typedef	_RawTy*			const_pointer;
		typedef	_RawTy*			pointer;
	};

	template<>
	class v2t_trait<void>
		:  protected _help::_v2t_base_memory
	{
		typedef	_help::_v2t_base_memory		base_type;
	public:
		typedef	base_type::difference_type	difference_type;
		typedef	base_type::size_type		size_type;

		typedef	void						value_type;

		typedef	const value_type*			const_pointer;
		typedef	const void					const_reference;
		typedef	value_type*					pointer;
		typedef	void						reference;
	};
}}

#endif	//	defined(__cplusplus)

//--------------------------------------------------------------------------
//==============================================================================
#endif	//	!defined(__LOLIX__TOY__STD_V2T__NICK__K_IN_G__)
